#include "../include/event_info_wrapper.h"
#include <cstring>

EventInfoWrapper::EventInfoWrapper()
{
	data = 0;
}

EventInfoWrapper::EventInfoWrapper(EventInfo &data, int priority)
{
	this->data = new EventInfo();
	*(this->data) = data;
	this->priority = priority;
}

EventInfoWrapper &EventInfoWrapper::operator=(EventInfoWrapper &evt_info)
{
	this->data = evt_info.data;
	this->priority = evt_info.priority;
	return *this;
}

bool EventInfoWrapper::equals(EventInfoWrapper &evt_info)
{
	return memcmp(data, evt_info.data, sizeof(EventInfo)) == 0 && priority == evt_info.priority;
}

bool EventInfoWrapper::operator==(EventInfoWrapper &evt_info)
{
	return priority == evt_info.priority;
}

bool EventInfoWrapper::operator>(EventInfoWrapper &evt_info)
{
	return priority > evt_info.priority;
}

bool EventInfoWrapper::operator<(EventInfoWrapper &evt_info)
{
	return priority < evt_info.priority;
}

bool EventInfoWrapper::operator>=(EventInfoWrapper &evt_info)
{
	return operator>(evt_info) || operator==(evt_info);
}

bool EventInfoWrapper::operator<=(EventInfoWrapper & evt_info)
{
	return operator<(evt_info) || operator==(evt_info);
}

void EventInfoWrapper::destruct()
{
	delete data;
}
